Skip to main content

weekofyear

weekofyear

Description

Syntax:

INT WEEKOFYEAR (DATETIME DATE)

This function calculates the week of year of the given date.

The parameter is of DATE or DATETIME type.

Example

mysql> select weekofyear('2008-02-20 00:00:00');
+-----------------------------------+
| weekofyear('2008-02-20 00:00:00') |
+-----------------------------------+
| 8 |
+-----------------------------------+

Keywords

WEEKOFYEAR